import pyautogui 
import time

# B站自动点赞脚本

time.sleep(3)
while True:
  time.sleep(0.5)
  if pyautogui.locateOnScreen('img/dianzan.png',confidence=0.7):
    pyautogui.moveTo(pyautogui.center(pyautogui.locateOnScreen('img/dianzan.png',confidence=0.7)),duration=0.3)
    pyautogui.click()
  else:
    pyautogui.scroll(-500)  # 本页没有图片，滚动鼠标
    print("没有目标，滚动一下")

    
